#!/usr/bin/env python

def init ( l, admin = 0 ):
	from liwe import parts
	from newsletter_class import Newsletter

	Newsletter ( l )

	#parts.add ( l.layman, [ "base" ] )

	l.layman.add_js ( "modules/newsletter/js/newsletter.js" )
	#l.layman.add_css ( "modules/newsletter/css/newsletter.css" )

	l.layman.add_js_code ( "newsletter.init();" )

	if admin and int ( admin ):
		parts.add_wwl ( l.layman, [ "panels" ] )
		l.layman.add_js ( "modules/newsletter/js/newsletter.admin.js" )
		l.layman.add_css ( "modules/newsletter/gfx/newsletter.admin.css" )
		l.layman.add_js_code ( "newsletter.admin.init();" )

	return ''
